home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume12 / unpackmaps3.0 / part01 next >
Encoding:
Text File  |  1990-05-14  |  18.8 KB  |  618 lines

  1. Newsgroups: comp.sources.misc
  2. subject: v12i099: Yet another release of unpackmaps.
  3. from: clewis@eci386 (Chris Lewis)
  4. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  5.  
  6. Posting-number: Volume 12, Issue 99
  7. Submitted-by: clewis@eci386 (Chris Lewis)
  8. Archive-name: unpackmaps3.0/part01
  9.  
  10. Here is a shar containing the latest version of my unpackmaps
  11. script ("secure map unpacker").  This is as far as I'm likely to take it.
  12.  
  13. #! /bin/sh
  14. # This is a shell archive.  Remove anything before this line, then feed it
  15. # into a shell via "sh file" or similar.  To overwrite existing files,
  16. # type "sh file -c".
  17. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  18. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  19. # If this archive is complete, you will see the following message at the end:
  20. #        "End of archive 1 (of 1)."
  21. # Contents:  README unpackmaps uuwhere
  22. # Wrapped by clewis@eci386 on Mon May 14 13:35:53 1990
  23. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  24. if test -f 'README' -a "${1}" != "-c" ; then 
  25.   echo shar: Will not clobber existing file \"'README'\"
  26. else
  27. echo shar: Extracting \"'README'\" \(7475 characters\)
  28. sed "s/^X//" >'README' <<'END_OF_FILE'
  29. X            UNPACKMAPS V3.0
  30. X              May 14 1990
  31. X              Chris Lewis
  32. X
  33. X    This README, unpackmaps and uuwhere are Copyright 1990 Chris Lewis,
  34. X    All Rights Reserved.
  35. X
  36. X    You can do anything you want with it, provided that this copyright
  37. X    notice remains intact, you don't claim you wrote it yourself, and you 
  38. X    don't make money selling it directly.  You may redistribute this as
  39. X    you wish, but if you modify it, you should clearly indicate in this
  40. X    README file that it has been modified, by whom, and describe what
  41. X    has been changed.  Reasonable copying charges are okay.
  42. X
  43. X    Though I have taken pains to ensure that this program is reasonably 
  44. X    reliable and secure, I cannot make any warrantee as to the reliability 
  45. X    or security of this software when used on any computer.  It is up to
  46. X    the user of this software to determine its suitability for their
  47. X    purposes and take responsibility for its operation.
  48. X
  49. XThis is source for a simple, *secure*, map unpacking facility.
  50. X
  51. XIt is much simpler than uuhosts, has roughly the same functionality,
  52. Xis easier to install, probably faster and more efficient (at least
  53. Xthe versions I've seen w.r.t. compression), and is considerably less 
  54. Xvulnerable to trojan maps than most map unpackers that other people use.
  55. X(It has fewer vulnerabilities than uuhosts)
  56. X
  57. XThe intent is that any UNIX/XENIX/BSD system that can run news will
  58. Xbe able to run this too, so I'm attempting to keep to greatest-common-
  59. Xdenominator except for pathalias and things that I implement myself.
  60. X
  61. XThis release includes:
  62. X
  63. X    - map unpacking
  64. X    - pathalias operation plus hooks for path customization.
  65. X    - a mechanism for viewing map entries for arbitrary sites.
  66. X      ("uuwhere")
  67. X    - automatic map article deletion if desired.
  68. X
  69. XThis had been posted to comp.sources.misc about a year ago.  The
  70. Xprime differences here are that compress is run as a pipeline as stdin to
  71. Xpathalias, so you don't need to modify pathalias anymore, and the
  72. Xnew "uuwhere" tool.  There is still no makefile because it wouldn't
  73. Xdo anything useful.
  74. X
  75. XRegarding security: as many may remember, there's been a fair bit of
  76. Xdiscussion on security of map unpacking on the net.  Rather than play
  77. Xaround with trying to make a secure *true* unshar, which probably noone would
  78. Xtrust because it would be so big, I simply made a few simplifying assumptions
  79. Xabout the map format and use an awk script to unpack a map article into
  80. Xa map file.  It checks for and refuses to unpack articles which have
  81. Xslashes in their names.  I sent off some mail to Mel asking whether the
  82. Xassumptions I've made about map format are true, but never got any
  83. Xresponse.  I believe that this is *pretty* secure, in that it doesn't
  84. Xhave to be run as root, doesn't use the Bourne shell for unpacking, and 
  85. Xis careful about the file names it creates.  Please let me know if there 
  86. Xare any holes I didn't think of.
  87. X
  88. XGeneral operation:
  89. X    - your news is modified to batch incoming map article file names
  90. X      to a specific batch file (analogous to normal news batching).  
  91. X      C-news users take note: you may have to utter magic incantations 
  92. X      (hint "classes" in C-news Alpha) to get sendbatches to avoid 
  93. X      trying to uux these...  Another way is to use an explicit batch 
  94. X      file name in the sys file that isn't under the usual "out.going"
  95. X      directories and point unpackmaps at it.
  96. X    - unpackmaps wakes up, usually once per day, and extracts the
  97. X      maps specified (if any) in the batch file into the map directory.
  98. X      Maps are extracted using a secure awk script without resort
  99. X      to setuid root or other wierdnesses.  If you want the uuwhere
  100. X      facility, unpackmaps will extract site->map file correspondences.
  101. X    - If any maps were extracted, pathalias is fired off, and the 
  102. X      resultant file put in the place specified.
  103. X    - If you've specified uuwhere, the where database will be regenerated.
  104. X    - if anything was done, unpackmaps sends you mail telling you
  105. X      what happened.
  106. X
  107. XInstallation:
  108. X    - If you want to compress the stored map files, set the COMPRESS
  109. X      variable to point your compress program.  You should be using
  110. X      compress versions 3 or 4.  A copy will have come with your
  111. X      news software.
  112. X
  113. X    - I STRONGLY recommend that you build a special version of compress
  114. X      with 12 bit compression instead of 16 for this.  When this
  115. X      is done, compress is considerably smaller (eg: bss of 32K instead
  116. X      of 400K+).  The reason for this is obvious - pathalias is enormous
  117. X      when it's running, and so is a 16 bit compress.  God help you if
  118. X      it starts to swap.
  119. X
  120. X      Advantages:
  121. X        - the whole thing runs considerably faster
  122. X        - much less swap/paging
  123. X        - on our machine, 16 bit compress practically hangs
  124. X          everyone else when run at the same time as pathalias.
  125. X
  126. X      Disadvantages:
  127. X        - the map directory is 10% (really!  only 10%!) bigger.
  128. X
  129. X      What I did was the following:
  130. X        - go to the source directory for compress
  131. X        - remove the binary if it is there.
  132. X        - say:
  133. X            make compress CFLAGS=-DUSERMEM=0
  134. X        - rename this to something like /usr/bin/compress12
  135. X        - make sure that uuwhere and unpackmaps shell scripts
  136. X          have the same name.  Eg: /usr/bin/compress12
  137. X
  138. X    - edit unpackmaps to set the variables at the beginning of
  139. X      the shell script.  Note especially the batch file name
  140. X      (see below)
  141. X    - make the directory for the map files, owned by news.
  142. X    - put unpackmaps in a suitable place.  Eg: /usr/lib/news
  143. X    - put uuwhere in a suitable place.  Eg: /usr/local/bin.
  144. X    - unpackmaps should be run from the userid that owns and runs news.
  145. X    - su to the news userid, and run:
  146. X        unpackmaps -i
  147. X      This will build the initial path file.
  148. X    - insert into your crontab something like:
  149. X        30 3 * * * /bin/su news -c "<path to unpackmaps>/unpackmaps > /dev/null"
  150. X    - insert into your news sys file something like:
  151. X
  152. X        (C-news)
  153. X
  154. X        maps:comp.mail.maps/all:f:/usr/spool/news/out.special/maps
  155. X
  156. X        (B-news)
  157. X
  158. X        maps:world,comp.mail.maps:F:/usr/spool/batch/maps
  159. X
  160. X    - copy uuwhere to an accessible bin directory after modifying
  161. X      the configuration section at the beginning.
  162. X    
  163. Xuuwhere "sitename" will give you the map name and line numbers where
  164. Xthe site is defined (with #N comments).  Adding a -v option will
  165. Xinvoke compress (if necessary) and show you the map entry itself.
  166. XThe uuwhere mechanism *only* works using the "#N" entries, and will
  167. Xnot search for macro reassignments and other namings.  One other drawback
  168. Xis that uuwhere won't display whole map files directly, but that was
  169. Xnever particularly useful anyways.
  170. X
  171. Xunpackmaps -i: will extract all map articles into the map spool area - useful
  172. Xfor the first time you use it.
  173. X
  174. Xunpackmaps -p: runs pathalias even if no map articles were extracted.
  175. X
  176. XIn order to push the paths file into /usr/lib/uucp, I created a file called
  177. Xpaths in /usr/lib/uucp, with 644 permissions, owned by the userid that runs
  178. Xunpackmaps.
  179. X
  180. XThe package will send mail to who you specify indicating which maps were
  181. Xunpacked, and any error returns from pathalias.
  182. X
  183. XThe uuwhere database is built from the maps as they are unpacked.  After
  184. Xinstallation, it may take a while for the where database to be complete.
  185. X(same as for path files themselves too).  I have implemented a binary
  186. Xsearch routine to make uuwhere go faster, but frankly, the sed's fast
  187. Xenough on all but the slowest machine.
  188. X
  189. XLet me know of any changes you needed to make to get this to work.
  190. XI'm also open to suggestions for new features....
  191. X----------
  192. XChris Lewis, Markham, Ontario, Canada
  193. X{uunet!attcan,utgpu,yunexus,utzoo}!lsuc!{ecicrl|eci386}!clewis
  194. END_OF_FILE
  195. if test 7475 -ne `wc -c <'README'`; then
  196.     echo shar: \"'README'\" unpacked with wrong size!
  197. fi
  198. # end of 'README'
  199. fi
  200. if test -f 'unpackmaps' -a "${1}" != "-c" ; then 
  201.   echo shar: Will not clobber existing file \"'unpackmaps'\"
  202. else
  203. echo shar: Extracting \"'unpackmaps'\" \(7735 characters\)
  204. sed "s/^X//" >'unpackmaps' <<'END_OF_FILE'
  205. X:
  206. X#    Unpackmaps Copyright 1990, Chris Lewis, All Rights Reserved
  207. Xtrap "rm -f /tmp/unp?$$; exit" 0 1 2 3 15
  208. XIFS="     
  209. X"
  210. Xexport IFS
  211. XPATH=/bin:/usr/bin
  212. Xexport PATH
  213. X
  214. X#    The name of the file that you've caused your news system to
  215. X#    batch the file names of the map articles.
  216. X# Eg: C-news
  217. X#BATCH=/usr/lib/news/batch/b.maps/togo
  218. X#Modern C-news (directory other than /usr/spool/news/out.going)
  219. XBATCH=/usr/spool/news/out.special/maps/togo
  220. X# Eg: B-news
  221. X#BATCH=/usr/spool/batch/maps
  222. X#    News spool directory
  223. XNEWSSPOOL=/usr/spool/news
  224. X#    Where you want the maps to go.
  225. X#    I like using /usr/spool/maps, but on our system, /usr/spool/news
  226. X#    is a separate file system, and /usr runs close to the limit...
  227. XMAPDIR=/usr/spool/news/maps
  228. X#    Person to send results and error messages to
  229. XNOTIFY=clewis
  230. X#    pathalias binary
  231. XPATHALIAS=/usr/lbin/pathalias
  232. X#    where you want the path files to go:
  233. X#    A convenient place is /usr/lib/uucp/paths which is the smail
  234. X#    default.  If you're going to put this in /usr/lib/uucp, I suggest
  235. X#    (rather than make /usr/lib/uucp writeable by everybody), doing
  236. X#    the following:
  237. X#        su root
  238. X#        cd /usr/lib/uucp
  239. X#        touch paths
  240. X#        chown news paths    (or usenet)
  241. X#        chmod 644 paths
  242. XPATHFILE=/usr/lib/uucp/paths
  243. X#    Auxiliary options to pathalias.  Tune to local tastes....
  244. XPATHOPTS="-dwatmath"
  245. X#    If you have a version[s] of your machine's map entry that is different 
  246. X#    from what's published, change this variable to point at it/them.
  247. X#    (Eg: I publish the first entry here, and the second one is local tuning
  248. X#    and hidden connections)
  249. XPATHLOCAL="/usr2/clewis/maps/path.local /usr2/clewis/maps/path.nonpublic"
  250. X#    If this variable is set to the compress binary, maps will be
  251. X#    compressed.
  252. XCOMPRESS=/usr2/clewis/maps/compress12
  253. X#    1 to strip comments from maps - don't do this if you want to use
  254. X#    uuwhere.  However, this is a great space saver...
  255. XNOCOMMENTS=0
  256. X#    Define to the name of a file where you want the where database
  257. X#    to be kept.  Undef if you don't want uuwhere at all.
  258. XWHEREFILE=$MAPDIR/where.db
  259. X#    Uncomment this if you want the map unpacker to remove the
  260. X#    News articles after the maps have been extracted from them.
  261. X#    DO NOT DO THIS IF YOU FORWARD MAP ARTICLES TO OTHER SITES!
  262. X#    This also relies on your awk returning "exit" codes properly.
  263. X#    Yours may not...
  264. X#UNLINK=1
  265. X#    PS: there is *one* possible edit that you might want to make
  266. X#    below - the maps used to generate wierd domains, but most of that
  267. X#    appears to be gone now (don't ask me, I never particularly understood
  268. X#    it, but since Peter Honeyman recommended it...).  If you object
  269. X#    to these wierd domains, uncomment the egrep.
  270. X
  271. X#    Edit no more....
  272. X
  273. Xumask 022
  274. X
  275. Xif test ! -d $MAPDIR -o ! -w $MAPDIR
  276. Xthen
  277. X    echo "$MAPDIR missing, unwritable or not a directory" >&2
  278. X    exit 1
  279. Xfi
  280. X
  281. Xif test $# = 1
  282. Xthen
  283. X    case $1 in
  284. X    -p)
  285. X        forcepath=true
  286. X        ;;
  287. X    -P)
  288. X        forcepath=false
  289. X        ;;
  290. X    -i)
  291. X        cd /
  292. X        rm -f $BATCH.work
  293. X        # using find/sort instead of ls just in case there's lots of
  294. X        # articles....
  295. X        find $NEWSSPOOL/comp/mail/maps -type f -print | sort > $BATCH
  296. X        ;;
  297. X    *)
  298. X        echo "usage: unpackmaps [-i] [-p]" >&2
  299. X        exit 1
  300. X        ;;
  301. X    esac
  302. Xfi
  303. X
  304. Xcd $MAPDIR
  305. XWHERETMP=/tmp/WHERE$$
  306. Xrm -f $WHERETMP
  307. X        
  308. Xwhile test -f $BATCH -o -f $BATCH.work
  309. Xdo
  310. X    # There is no window of vulnerability here as long as noone else is
  311. X    # creating $BATCH.work.
  312. X    if test ! -f $BATCH.work
  313. X    then
  314. X    mv $BATCH $BATCH.work
  315. X    fi
  316. X
  317. X    while read i stuff
  318. X    do
  319. X    #    Using stuff to capture remaining junk on line.
  320. X    #    Eg: C-news article sizes.
  321. X
  322. X    if test -z "$i"
  323. X    then
  324. X        break
  325. X    fi
  326. X
  327. X    if test ! -r $i
  328. X    then
  329. X        echo "$i apparently superseded or expired"
  330. X        continue
  331. X    fi
  332. X
  333. X    # This awk script depends on the following map article format:
  334. X    # <don't cares>
  335. X    # cat << 'something' > filename
  336. X    # map body
  337. X    # something
  338. X    # <don't cares>
  339. X    # "something" doesn't have to be enclosed in quotes in the cat line.
  340. X    # This isn't particularly fast - could be dramatically speeded up
  341. X    # if written in C, but I was trying to ensure that this is as simple
  342. X    # and self-evident as possible.
  343. X
  344. X    awk '
  345. X    BEGIN    {
  346. X        where = "'"$WHEREFILE"'"
  347. X        }
  348. X    $1 == "cat" && collecting == 0 {
  349. X        recno = 1
  350. X        endtoken=$3;
  351. X        if (substr(endtoken, 1, 1) == "'"'"'")
  352. X            endtoken=substr(endtoken, 2, length(endtoken)-2);
  353. X        collecting = 1;
  354. X        foundone = 1;
  355. X        name = $5;
  356. X        if (index(name, "/") != 0) {
  357. X            printf("Security violation attempt in %s!\n", "'$i'");
  358. X            exit 1;
  359. X        } else
  360. X            printf("extracting %s from %s\n", name, "'$i'");
  361. X        next;
  362. X        }
  363. X
  364. X        {
  365. X        if (!collecting)
  366. X            next;
  367. X        if ($1 == endtoken) {
  368. X            line = "rm -f " name ".Z"
  369. X            print "" | line
  370. X            collecting = 0;
  371. X            next
  372. X        }
  373. X        if ($1 ~ /^#N/ && where) {
  374. X            for (i = 2; i <= NF; i++) {
  375. X            sname = $i
  376. X            if (p = index(sname, ","))
  377. X                sname = substr(sname, 1, p-1)
  378. X            printf "@%s %s %d\n", sname, name, recno >> \
  379. X                "'$WHERETMP'";
  380. X            }
  381. X        }
  382. X        if ("'$NOCOMMENTS'" == 1 && $0 ~ /#/)
  383. X            print substr($0, 1, index($0, "#")) > name
  384. X        else {
  385. X            print $0 > name
  386. X        }
  387. X        recno++
  388. X        }
  389. X        
  390. X        END {
  391. X        if (collecting) {
  392. X            printf("Non-terminated map in %s\n", "'$i'");
  393. X            exit 1;
  394. X        }
  395. X        if (!foundone) {
  396. X            printf("%s does not contain a properly formed map\n", "'$i'");
  397. X            exit 1;
  398. X        }
  399. X        }' $i
  400. X
  401. X    if test $? = 0 -a -n "$UNLINK"
  402. X    then
  403. X        rm -f $i
  404. X    done
  405. X
  406. X    done < $BATCH.work
  407. X    rm $BATCH.work
  408. Xdone > /tmp/unpA$$ 2>&1
  409. X
  410. Xif test -n "$COMPRESS"
  411. Xthen
  412. X    files=`ls ?.* | sed -e '/\.Z$/d'`
  413. X    if test -n "$files"
  414. X    then
  415. X    $COMPRESS -f $files
  416. X    fi
  417. Xfi
  418. X
  419. Xif test -f "$PATHALIAS" -a "$forcepath" != false
  420. Xthen
  421. X    if test -s /tmp/unpA$$ -o "$forcepath" = true
  422. X    then
  423. X    cd $MAPDIR
  424. X
  425. X    (
  426. X    if test -n "$COMPRESS"
  427. X    then
  428. X        $COMPRESS -dc [ud].*.Z | cat - $PATHLOCAL
  429. X    else
  430. X        cat [ud].* $PATHLOCAL
  431. X    fi |
  432. X
  433. X    $PATHALIAS -f $PATHOPTS |
  434. X
  435. X    # format of the pathalias -f output is
  436. X    # cost    host    route
  437. X    #
  438. X    # format of a 'paths' file for smail is
  439. X    # host    route    first_hop_cost
  440. X    #
  441. X    # move cost field to end of line:
  442. X
  443. X    sed 's/\(.*\)    \(.*\)    \(.*\)/\2    \3    \1/' |
  444. X
  445. X    # convert target domain/host to lower case:
  446. X
  447. X    #lcasep |
  448. X    
  449. X    # remove some additional wierdnesses (per Peter Honeyman):
  450. X    # You can leave it in or not.
  451. X
  452. X    # egrep -v '(\.(com|edu|mil|gov|net|org|arpa|[a-z][a-z])    .*!.*!)|(.\.(com|edu|mil|gov|net|org|arpa|[a-z][a-z])    )' |
  453. X
  454. X    # sort the stream:
  455. X    
  456. X    sort > /tmp/paths ) > /tmp/unpB$$ 2>&1
  457. X
  458. X    if test ! -s /tmp/paths
  459. X    then
  460. X        echo "Pathalias failed no map file created" >> /tmp/unpB$$
  461. X    else
  462. X        cat /tmp/paths > $PATHFILE 2>> /tmp/unpB$$
  463. X        if test $? != 0
  464. X        then
  465. X        echo "Copy to $PATHFILE failed" >> /tmp/unpB$$
  466. X        else
  467. X        rm /tmp/paths
  468. X        fi
  469. X        echo "Map remade" >> /tmp/unpB$$
  470. X        ls -l $PATHFILE >> /tmp/unpB$$
  471. X    fi
  472. X
  473. X    if test -s /tmp/unpB$$
  474. X    then
  475. X        echo "Pathalias output:" >> /tmp/unpA$$
  476. X        cat /tmp/unpB$$ >> /tmp/unpA$$
  477. X    fi
  478. X    fi
  479. Xfi
  480. X
  481. Xif test -n "$WHEREFILE" -a -s $WHERETMP
  482. Xthen
  483. X    if test ! -f $WHEREFILE
  484. X    then
  485. X    touch $WHEREFILE
  486. X    fi
  487. X
  488. X    # First awk: throws away WHERE references in $WHEREFILE that
  489. X    #    are now in $WHERETMP
  490. X    # Sort: sort by site name
  491. X    # Second awk: coalesce references to same site/file to one line.
  492. X    awk '
  493. X    BEGIN {
  494. X        mapseen[""] = 1
  495. X    }
  496. X    $1 ~ /^@/ {
  497. X        printf("%s %s %s\n", substr($1, 2), $2, $3);
  498. X        mapseen[$2] = 1
  499. X        next;
  500. X    }
  501. X    {
  502. X        if (mapseen[$2])
  503. X        next
  504. X        printf("%s %s %s\n", $1, $2, $3);
  505. X    }' $WHERETMP $WHEREFILE | 
  506. X    sort | 
  507. X    awk '
  508. X    {
  509. X        if (site != $1 || map != $2) {
  510. X        if (site)
  511. X            printf("\n");
  512. X        site = $1
  513. X        map = $2
  514. X        printf("%s %s %s", $1, $2, $3);
  515. X        } else
  516. X        printf(",%s", $3);
  517. X    }
  518. X    END {
  519. X        printf("\n");
  520. X    }' > /tmp/TMP2
  521. X    
  522. X    if test -s /tmp/TMP2
  523. X    then
  524. X    cat /tmp/TMP2 > $WHEREFILE
  525. X    fi
  526. X    echo "Where database ($WHEREFILE) rebuilt" >> /tmp/unpA$$
  527. Xfi
  528. Xrm -f /tmp/TMP2 $WHERETMP
  529. X
  530. Xif test -s /tmp/unpA$$
  531. Xthen
  532. X    mail $NOTIFY < /tmp/unpA$$
  533. Xfi
  534. END_OF_FILE
  535. if test 7735 -ne `wc -c <'unpackmaps'`; then
  536.     echo shar: \"'unpackmaps'\" unpacked with wrong size!
  537. fi
  538. chmod +x 'unpackmaps'
  539. # end of 'unpackmaps'
  540. fi
  541. if test -f 'uuwhere' -a "${1}" != "-c" ; then 
  542.   echo shar: Will not clobber existing file \"'uuwhere'\"
  543. else
  544. echo shar: Extracting \"'uuwhere'\" \(852 characters\)
  545. sed "s/^X//" >'uuwhere' <<'END_OF_FILE'
  546. X:
  547. X#    Copyright 1990, Chris Lewis, All Rights Reserved
  548. XMAPDIR=/usr/spool/news/maps
  549. XWHEREFILE=$MAPDIR/where.db
  550. XCOMPRESS=/usr2/clewis/maps/compress12
  551. X
  552. Xif [ $1 = "-v" ]
  553. Xthen
  554. X    verbose=1
  555. X    shift
  556. Xfi
  557. Xfor i
  558. Xdo
  559. X    echo Searching for $i
  560. X    if [ -n "$verbose" ]
  561. X    then
  562. X    list=`sed -n -e "/^$i/s/[     ][     ]*/:/gp" $WHEREFILE`
  563. X    for j in $list
  564. X    do
  565. X        eval `echo $j | sed -e 's/\([^:]*\):\([^:]*\):\(.*\)/s=\1 f=\2 l=\3/p'`
  566. X        echo $s $f $l
  567. X        numlist=`echo $l | sed -e 's/[, ][, ]*/ /g'`
  568. X        for l in $numlist
  569. X        do
  570. X        echo "Found $s in $f at line $l"
  571. X        if [ -n "$f" -a -n "$l" ]
  572. X        then
  573. X            if [ -r $MAPDIR/$f ]
  574. X            then
  575. X            cat $MAPDIR/$f
  576. X            elif [ -r $MAPDIR/$f.Z ]
  577. X            then
  578. X            $COMPRESS -dc $MAPDIR/$f.Z
  579. X            else
  580. X            echo "No such file $f" >&2
  581. X            fi | sed -n -e "$l,/^#N/p"
  582. X        fi
  583. X        done
  584. X    done
  585. X    else
  586. X    grep "^$i" $WHEREFILE
  587. X    fi
  588. Xdone
  589. END_OF_FILE
  590. if test 852 -ne `wc -c <'uuwhere'`; then
  591.     echo shar: \"'uuwhere'\" unpacked with wrong size!
  592. fi
  593. chmod +x 'uuwhere'
  594. # end of 'uuwhere'
  595. fi
  596. echo shar: End of archive 1 \(of 1\).
  597. cp /dev/null ark1isdone
  598. MISSING=""
  599. for I in 1 ; do
  600.     if test ! -f ark${I}isdone ; then
  601.     MISSING="${MISSING} ${I}"
  602.     fi
  603. done
  604. if test "${MISSING}" = "" ; then
  605.     echo You have the archive.
  606.     rm -f ark[1-9]isdone
  607. else
  608.     echo You still need to unpack the following archives:
  609.     echo "        " ${MISSING}
  610. fi
  611. ##  End of shell archive.
  612. exit 0
  613.  
  614. -- 
  615. Chris Lewis, Elegant Communications Inc, {uunet!attcan,utzoo}!lsuc!eci386!clewis
  616. Ferret mailing list: eci386!ferret-list, psroff mailing list: eci386!psroff-list
  617.  
  618.